#!/bin/bash

# 演示使用AND列表

touch /tmp/file1

rm -rf /tmp/file2

if [ -f /tmp/file1 ] && echo "hello file1" && [ -f /tmp/file2 ] && echo "hello file2"; then
    echo "in if"
else
    echo "in else"
fi

echo "OR demo"
if [ -f /tmp/file2 ] || echo "file2 not exists" || echo "never run"; then
    echo "in if"
else
    echo "in else"
fi
